package com.yingran.common;

import android.text.TextUtils;
import android.util.Log;

/**
 * Created by Ksy
 */

public class LogTool {
    private static final String TAG = "LogTool";
    public static final boolean enable = true;

    public static void e(Object object) {
        if (object == null) {
            e(TAG, "  object  is   null");
        } else {
            e(TAG, object.toString());
        }
    }

    public static void w(Object object) {
        if (object == null) {
            w(TAG, "  object  is   null");
        } else {
            w(TAG, object.toString());
        }
    }

    public static void e(String tag, String msg) {


        if (enable) {
            if (TextUtils.isEmpty(msg)) {
                Log.e(tag, "It's a null message");
            } else {
                Log.e(tag, msg);
            }
        }

    }

    public static void w(String tag, String msg) {
        if (enable)
            Log.w(tag, msg);
    }


}
